<%@ page contentType="text/html; charset=utf-8"%>

<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>
<%@ include file="/WEB-INF/jsp/includeCss.jsp" %>
<%@ include file="/WEB-INF/jsp/includeJs.jsp" %>


<table width="100%" border="0" cellpadding="0" cellspacing="5">
	<tr>
		<td valign="top">
			<table class="dbborder" width="100%" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td valign="bottom" class="blueTableBg">&nbsp;&nbsp;任务详情</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<div class="globalText" style="padding: 15px;border: solid 1px #999999;width: 768px;margin-left: 15px;" >
	<table class="globalText dbborder" width="100%" border="0" cellpadding="5" cellspacing="5" style="margin: 5px;">
		<tr>
			<td width="10%">项目名称:</td>
			<td>
				${planJobResult.planJob.planProject.projectName}
			</td>
		</tr>

		<tr>
			<td>终端名称:</td>
			<td>
				${planJobResult.planJob.storeName}
			</td>
		</tr>
		<tr>
			<td>任务日期:</td>
			<td>
				${planJobResult.planJob.planProject.plan.planDate}
			</td>
		</tr>
		<tr>
			<td>任务时间:</td>
			<td>
				${planJobResult.planJob.startTime} ~ ${planJobResult.planJob.endTime}
			</td>
		</tr>
		<tr>
			<td>任务状态:</td>
			<td>
				${planJobResult.jobStatus}
			</td>
		</tr>
		<tr>
			<td>原因汇报:</td>
			<td>
				${planJobResult.notes}
			</td>
		</tr>
		<tr>
			<td>任务名称:</td>
			<td>
				<b id="taskName"></b>
			</td>
		</tr>

	</table>

</div>
<!-- stepResults.data -->

<div class="globalText" style="padding: 15px 15px 15px 0px; width: 73.6%; margin-left: 15px;">
	<div id="tabs" style="border: solid 1px #999999; width: 100%" class="divLeft3">
		<c:forEach var="stepResults" items="${userStepResults}" varStatus="status" >
			<dl>
				<dd taskName="${stepResults.step.task.taskName}" actionId="${stepResults.actionId}" data="${stepResults.data}" onclick="javascript:viewDetail(this);" style="width:30%; text-align: center;">
					<a href="javascript:;">
					
					${status.index+1}.${stepResults.step.name}
					
					<c:if test="${stepResults.step.stepItem != NULL }">
						(${stepResults.step.stepItem.step.name}
						--
						${stepResults.step.stepItem.taskItem.name})
					</c:if>
					
					</a>
				</dd>
			</dl>
		</c:forEach>
	</div>
	<div class="clear"></div>
	<div id="contentView" style="float: inherit;width: 500px;margin-top: 60px;">

	</div>
</div>


<script>
	function viewDetail(obj){
		$("#taskName").html($(obj).attr("taskName"));
		$("#contentView").empty();
        var actionId = $(obj).attr("actionId");
        var data = $(obj).attr('data');
		if (actionId == 1) {
			$("#contentView").append("<img src='${CONTENT_REPO_PATH}"+ data +"' />");
        } else if (actionId == 7) {
            if (data.match(/(.jpg|.jpeg|.png|.gif|.bmp)$/i)) {
			    $("#contentView").append("<img src='${CONTENT_REPO_PATH}"+ data +"' />");
            } else {
                $("#contentView").append("<a href='${CONTENT_REPO_PATH}"+ data +"' >下载附件</a>");
            }
		} else {
			$("#contentView").html(data);
		}

	}
</script>


